﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Cnm.Core.Ultities;
using Cnm.Models;
using Cnm.Models.ViewModels;
using Cnm.Mvc.Web.Ultilities;

namespace Cnm.Mvc.Web.Controllers
{
    public class SearchController : Controller
    {
        private readonly CnmDemoEntities dbContext = new CnmDemoEntities();

        public ActionResult Index(int? c, string s = "")
        {
            s = s.Trim();

            ViewBag.SearchCatId = c != null ? c.ToString() : string.Empty;
            ViewBag.SearchKeyword = s;
            var model = new PostConditionViewModel
            {
                CategoryId = c,
                Keyword = s
            };
            return View(model);
        }
	}
}